var express=require("express");
var seneca=require("seneca")();
var Web=require("seneca-web");
var server=express();
seneca.use(Web, {adapter: require('seneca-web-adapter-express'),context: server});
seneca.act({role:'web'},{routes:{
    prefix:"/myapi",
    pin:"role:math1,cmd:*",   //不可写成json格式
    map:{
        sum1:{GET:true}
    }
}});
seneca.add({role:"math1",cmd:"sum1"},function(msg,respond){
    respond(null,{"sum":112});
});
server.listen(3000);